<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8' />
<link href='../packages/core/dist/main.css' rel='stylesheet' />
<link href='../packages/daygrid/dist/main.css' rel='stylesheet' />
<link href='../packages/timegrid/dist/main.css' rel='stylesheet' />
<script src='../packages/core/dist/main.js'></script>
<script src='../packages/interaction/dist/main.js'></script>
<script src='../packages/daygrid/dist/main.js'></script>
<script src='../packages/timegrid/dist/main.js'></script>
<script src='../packages-premium/resource-common/dist/main.js'></script>
<script src='../packages-premium/resource-daygrid/dist/main.js'></script>
<script src='../packages-premium/resource-timegrid/dist/main.js'></script>
<script>

  document.addEventListener('DOMContentLoaded', function() {
    var calendarEl = document.getElementById('calendar');

    var calendar = new FullCalendar.Calendar(calendarEl, {
      plugins: [ 'interaction', 'resourceDayGrid', 'resourceTimeGrid' ],
      defaultView: 'resourceTimeGridDay',
      defaultDate: '2019-08-07',
      editable: true,
      selectable: true,
      eventLimit: true, // allow "more" link when too many events
      header: {
        left: 'prev,next today',
        center: 'title',
        right: 'resourceTimeGridDay,resourceTimeGridTwoDay,timeGridWeek,dayGridMonth'
      },
      views: {
        resourceTimeGridTwoDay: {
          type: 'resourceTimeGrid',
          duration: { days: 2 },
          buttonText: '2 days',
        }
      },

      //// uncomment this line to hide the all-day slot
      //allDaySlot: false,

      resources: [
        { id: 'a', title: 'Room A' },
        { id: 'b', title: 'Room B', eventColor: 'green' },
        { id: 'c', title: 'Room C', eventColor: 'orange' },
        { id: 'd', title: 'Room D', eventColor: 'red' }
      ],
      events: [
        { id: '1', resourceId: 'a', start: '2019-08-06', end: '2019-08-08', title: 'event 1' },
        { id: '2', resourceId: 'a', start: '2019-08-07T09:00:00', end: '2019-08-07T14:00:00', title: 'event 2' },
        { id: '3', resourceId: 'b', start: '2019-08-07T12:00:00', end: '2019-08-08T06:00:00', title: 'event 3' },
        { id: '4', resourceId: 'c', start: '2019-08-07T07:30:00', end: '2019-08-07T09:30:00', title: 'event 4' },
        { id: '5', resourceId: 'd', start: '2019-08-07T10:00:00', end: '2019-08-07T15:00:00', title: 'event 5' }
      ],

      select: function(arg) {
        console.log(
          'select',
          arg.startStr,
          arg.endStr,
          arg.resource ? arg.resource.id : '(no resource)'
        );
      },
      dateClick: function(arg) {
        console.log(
          'dateClick',
          arg.date,
          arg.resource ? arg.resource.id : '(no resource)'
        );
      }
    });

    calendar.render();
  });

</script>
<style>

  body {
    margin: 0;
    padding: 0;
    font-family: Arial, Helvetica Neue, Helvetica, sans-serif;
    font-size: 14px;
  }

  #calendar {
    max-width: 900px;
    margin: 50px auto;
  }

</style>
</head>
<body>

  <div id='calendar'></div>

</body>
</html>
